package com.zzj.controller;

import com.zzj.base.Result;
import com.zzj.entity.Department;
import com.zzj.service.IDepartmentService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zzj
 * @since 2023-02-16
 */
@RestController
@RequestMapping("/department")
public class DepartmentController {

    @Resource
    private IDepartmentService departmentService;

    @PostMapping("/list")
    public Result list(){
        List<Department> list = departmentService.list();
        return Result.success(list);
    }
}
